import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    sysInfo: {
      model: '', // 获取手机型号
      version: '', // 获取微信版本号
      system: '', // 获取操作系统版本
      platform: '', // 获取客户端平台
      SDKVersion: '' // 获取客户端基础库版本
    },
    BTEDevId: '', // 蓝牙打印未连接
    // 打印机特征值
    BTDevCharact: {
      deviceId: '',
      serviceId: '',
      uuid: ''
    }
  },
  mutations: {
    commitModel (state, arg) {
      state.sysInfo.model = arg
    },
    commitVersion (state, arg) {
      state.sysInfo.version = arg
    },
    commitSystem (state, arg) {
      state.sysInfo.system = arg
    },
    commitPlatform (state, arg) {
      state.sysInfo.platform = arg
    },
    commitSDKVersion (state, arg) {
      state.sysInfo.SDKVersion = arg
    },
    commitChangeBTStatus (state, arg) {
      state.BTEDevId = arg
    },
    commitBTDevCharact (state, arg) {
      state.BTDevCharact = JSON.parse(JSON.stringify(arg))
    }
  }
})
